/**
 * @author Bernhard Denner
 * @author Maximilian Csuk
 * @author Konrad Paumann
 */
public class Computer implements Better<Computer> {
	private int RAMSize;
	private int diskSize;
	private int programRuntime;
	
	
	public Computer(int RAMSize, int diskSize, int programRuntime) {
		this.RAMSize = RAMSize;
		this.diskSize = diskSize;
		this.programRuntime = programRuntime;
	}
	/**
	 * Gets the RAM size of the computer.
	 */
	public int getRAMSize() {
		return RAMSize;
	}
	/**
	 * Gets the disk size of the computer.
	 */
	public int getDiskSize() {
		return diskSize;
	}
	/**
	 * Gets the runtime of the program
	 */
	public int getProgramRuntime() {
		return programRuntime;
	}
	/**
	 * Checks if this computer is better than the computer in the argument.
	 * The comparison is based on two characteristics: RAM size and disk size.
	 * A computer is better than the other, if it is better in at least one 
	 * characteristic and if it is not worse in either of the three
	 * characteristcs.
	 * Returns 	true if this computer is better,
	 * 			false otherwise.
	 */
	public boolean better(Computer c) {
		if (this.RAMSize >= c.getRAMSize() && 
				this.diskSize >= c.getDiskSize() &&
				this.programRuntime >= c.getProgramRuntime()) {
			
			if (this.RAMSize > c.getRAMSize() || 
					this.diskSize > c.getDiskSize() || 
					this.programRuntime > c.getProgramRuntime()) {
				
				return true;
			} else 
				return false;
		} else
			return false;
	}
	/**
	 * Returns a string representation of the computer.
	 */
	public String toString() {
		return 	"RAM: " + Integer.toString(RAMSize) + "MB | " + 
				"Disk: " + Integer.toString(diskSize) + "GB | " +
				"Programruntime: " + Integer.toString(programRuntime) + "ms |";
	}
}
